public class arrDome2 {
    public static void main(String[] args) {
        int [] a={1,23,5,6,66,16 };
        //遍历数组
//        for (int i=0;i<a.length;i++){
//            System.out.print("\t"+a[i]);
//        }
        //冒泡排序
        for (int i=0;i<a.length;i++){
           System.out.print("\t"+a[i]);
       }
        System.out.println();
        for (int i=1;i<a.length;i++){
            for (int j=0;j<a.length-i;j++){
                if (a[j]>a[j+1]){
                    int temp=a[j];
                    a[j]=a[j+1];
                    a[j+1]=temp;
                }
            }
        }
        for (int i=0;i<a.length;i++){
            System.out.print(a[i]+" ");
        }
    }
}
